<template>
    <div class="box">
        <div class="top">
            <p class="title">实时游客统计</p>
            <p class="bg"></p>
            <p class="right">可预约人数<span class="number">999</span>人</p>
        </div>
        <div class="personNumber">
            <span v-for="(item, index) in person" :key="index">{{ item }}</span>
        </div>
        <div class="echarts" ref="charts"></div>
    </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
import 'echarts-liquidfill'

let person = ref('216908人')
let charts = ref()

onMounted(() => {
    let mycharts = echarts.init(charts.value)
    mycharts.setOption({
        title: {
            text: '水球图'
        },
        xAxis: {

        },
        yAxis: {

        },
        series: {
            type: 'liquidFill',
            data: [0.41],
            radius:'80%'
        },
        //布局组件 
        grid: {
            top: 0,
            bottom: 0,
            right: 0,
            left: 0
        }
    })
})
</script>

<style scoped lang="scss">
.box {
    background: url(../../images/dataScreen-main-lb.png) no-repeat;
    background-size: 100% 100%;
    margin-top: 10px;

    .top {
        margin-left: 20px;

        .title {
            color: white;
            font-size: 20px;
        }

        .bg {
            width: 68px;
            height: 7px;
            background: url(../../images//dataScreen-title.png) no-repeat;
            background-size: 100% 100%;
            margin: 10px 0;
        }

        .right {
            float: right;
            color: white;
            margin-right: 8px;

            .number {
                color: orange;
                margin: 0 5px;
            }
        }
    }

    .personNumber {
        padding: 10px;
        margin-top: 30px;
        display: flex;

        span {
            flex: 1;
            height: 40px;
            text-align: center;
            line-height: 40px;
            background: url(../../images/total.png) no-repeat;
            background-size: 100% 100%;
            color: #29fcff;
            font-weight: 800;
        }
    }

    .echarts {
        width: 100%;
        height: 250px;
    }
}
</style>